import 'package:pigeon/pigeon.dart';

@ConfigurePigeon(PigeonOptions(
  dartOut: './lib/x5_request.dart',
  kotlinOut: 'android/src/main/kotlin/com/ytx/flutter_ytx_plugin/X5Pigeon.kt',
  kotlinOptions: KotlinOptions(
    package: 'com.ytx.flutter_ytx_plugin',
  ),
  objcHeaderOut: 'ios/Classes/X5Pigeon.h',
  objcSourceOut: 'ios/Classes/X5Pigeon.m',
  objcOptions: ObjcOptions(
    prefix: 'FLT',
  ),
))
@HostApi()
abstract class X5Request {
  void initX5Sdk();
  void openVideo(Map<String, Object> map);
  void openFile(Map<String, Object> map);
  void openWebActivity(Map<String, Object>? map);
  void setDownloadWithoutWifi(Map<String, Object> map);
  void loadUrl(String url, {Map<String, Object>? headers});
  void reload();
  void canGoBack();
  void canGoForward();
  void goBack();
  void goForward();
  void goBackOrForward(int point);
  String currentUrl();
  void evaluateJavascript(Map<String, Object> map);
  void addJavascriptChannels(Map<String, Object> map);
}

@FlutterApi()
abstract class X5Response {
  void onPlatformViewCreated(int p0);
  void onDownloadFinish(int p0);
  void onInstallFinish(int p0);
  void onDownloadProgress(int p0);
  void onCoreInitFinished(int p0);
  void onViewInitFinished(int p0);
  void onShowCustomView();
  void onHideCustomView();
 void  onJavascriptInterface(Map<String, Object> map);
  void onUrlLoading(Map<String, Object> map);
  void onPageStarted(Map<String, Object> map);
  void onPageFinished(Map<String, Object> map);
  void onProgressChanged(Map<String, Object> map);
}
